<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<title>Login page</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> 
<style>
body{background:url(img/bg.jpg);}

.header{width:100%; float:left;}

#logo{width:100%;}

.login-heading{text-align:center; color:#FFFFFF;}

.loginform {
    width: 100%;
    height: 250px;
    background:url('img/login_bg.png') no-repeat scroll center top transparent;
}

.login{width:30%; text-align:center; margin:0px auto;}
.login-input{width:280px; height:25px; background:#320b28; color:#FFFFFF;}
.submit{background:#000; border:none; height:25px; width:100px; margin-top:20px; color:#FFFFFF;}
a{
text-decoration: none;
font-family: "Monotype Corsiva";
font-size: 18px;
float: right;
margin-right: 393px;
margin-top: -41px;
color:purple;
}
a:hover{
text-decoration: underline;
color:blue;
}
</style>
<script type="text/javascript">
$(document).ready(function() {  
	$('#submit').click(function(event) {
		$('#traderId').val($('#uname').val());
	 }); 
	
 });
</script>

<script type = "text/javascript" >
window.history.forward();
function preventBack() { window.history.forward(1); }
</script>

</head>
<body onload="preventBack();" onpageshow="if (event.persisted) preventBack();" onunload="">
<div class="header">
	<div id="logo"><img src="img/ncmx-logo.png" style="width:25%;"/></div>
</div>

<div class="login-heading">
	<h1 style="font-family:Monotype Corsiva;">Welcome To NMCEX Exchange Login Panel</h1>
</div>

	<c:if test="${param.error}">
		 <div class="error">
			Your login attempt was not successful, try again.<br /> Reason:
			#{sessionScope.SPRING_SECURITY_LAST_EXCEPTION.message}
		</div> 
	</c:if>
<div class="loginform">
	<form name='f' action='/ncmxtradeX/login' method="post" class="login">
		<table style="border:none; clear:both; text-align:center; padding:50px 20px;">
        	<tbody>
			<tr>
				<td style="font-family:Monotype Corsiva; font-weight:700; font-size:21px;color:purple">User:</td>
				<td><input type='text' id='uname' name='username' value='' class="login-input" /></td>
			</tr>
			<tr>
				<td style="font-family:Monotype Corsiva; font-weight:700; font-size:21px;color:purple">Password:</td>
				<td><input type='password' name='password' class="login-input" /></td>
			</tr>
			<td><input type='hidden' name='traderId' id="traderId" class="login-input" /></td>
			<tr>
				<td><input type="checkbox" name="_spring_security_remember_me" /></td>
				<td style="font-family:Monotype Corsiva; font-size:18px;">Don't ask for my password for two weeks</td>
			</tr>
			
			<tr>
				<td colspan='2'><input name="submit" id="submit" type="submit" value="Login" class="submit" /></td>
			</tr>
            </tbody>
		</table>
		
	</form>
	<a href="forgotPwd" >Forgot Password</a>
</div>
</body>

</html>